/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.ensisa.sunspot.actor.writer.strategy;

import fr.ensisa.sunspot.actor.writer.media.IMedia;
import fr.ensisa.sunspot.event.IEvent;

/**
 *
 * @author michel
 */
public class ImmediatWriter extends AbstractWriteStrategy {

    public ImmediatWriter (IMedia media) {
        super(media);
    }

    public void write (long timeStamp, IEvent incomingEvent) {
        if (! isActivated()) return;
        if (incomingEvent == null) return;
        getMedia().writeHeader (timeStamp, incomingEvent);
        getMedia().writeEvent (timeStamp, incomingEvent);
        getMedia().writeTrailer (timeStamp, incomingEvent);
    }

}
